Attribute VB_Name = "modUIRedraw"
' In a module like modUIRedraw
Private Declare Function RedrawWindow Lib "user32" _
    (ByVal hWnd As Long, ByVal lprcUpdate As Long, _
     ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long

Private Const RDW_INVALIDATE = &H1
Private Const RDW_UPDATENOW = &H2
Private Const RDW_ERASE = &H4

Public Sub ForceRedrawCommand(ctrl As Object)
    On Error Resume Next  ' Prevent crash if hWnd isn't ready
    RedrawWindow ctrl.hWnd, 0, 0, RDW_INVALIDATE Or RDW_UPDATENOW Or RDW_ERASE
End Sub


